package io.sousou.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.sousou.enums.ResultEnum;
import io.sousou.handle.ExceptionHandle;


/**
 * 异常类
 * @author allen
 * 2017-10-01 14:05
 */
public class E extends RuntimeException{
	private final static Logger logger = LoggerFactory.getLogger(E.class);
	
	private static final long serialVersionUID = 1L;
	private Integer code;
	

    public E(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
        logger.error("发生异常");
        logger.error("error={}",this);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
